package com.wang.utils;

import lombok.*;

/**
 * @Classname ResponseUtil
 * @Description TODO
 * @Date 2025/3/20 9:04
 * @Created by pc
 */
@Data
@ToString
@NoArgsConstructor
@AllArgsConstructor
public class ResponseUtil {
    private Integer code;
    private String msg;
    private Object data;

    public static ResponseUtil get(ResponseEnum responseEnum,Object data){
        return new ResponseUtil(responseEnum.getCode(),responseEnum.getMsg(),data);
    }

    public static ResponseUtil get(ResponseEnum responseEnum){
        return new ResponseUtil(responseEnum.getCode(),responseEnum.getMsg(),null);
    }
}
